package Month07.day21.stu;

import java.util.Arrays;

public class test4 {
    public static void main(String[] args) {
        String str="46 27 91 38 50";
        int[] ints = new int[5];
        String[] strings=str.split(" ");
        for (int i = 0; i < strings.length; i++) {
            int value=Integer.parseInt(strings[i]);
            ints[i]=value;
        }
        for (int i = 0; i < ints.length-1; i++) {
            for (int j = 0; j < ints.length-1-i; j++) {
                if (ints[j]>ints[j+1]){
                    int temp=ints[j];
                    ints[j]=ints[j+1];
                    ints[j+1]=temp;
                }
            }
        }
        System.out.println(Arrays.toString(ints));
    }
}
